﻿@model IEnumerable<Fmis10_1.Models.Team>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Default.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <td>
            @Html.DisplayNameFor(model => model.TeamName)
        </td>
        <td>
            @Html.DisplayNameFor(model => model.Club.ClubName)
        </td>
        <td>
            @Html.DisplayNameFor(model => model.Webpage)
        </td>
        <td>
            @Html.DisplayNameFor(model => model.Gender)
        </td>
        <td>
            @Html.DisplayNameFor(model => model.Division)
        </td>     
        <td></td>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.TeamName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Club.ClubName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Webpage)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Gender)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Division)
        </td>
        
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.TeamId }) |
            @Html.ActionLink("Details", "Details", new { id=item.TeamId }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.TeamId })
        </td>
    </tr>
}

</table>
